<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<div id="siderIMchat">
  <div id="siderIMchat_hiddenbar"></div>
  <div id="siderIMchat_main">
    <div class="top"></div>
    <div class="bg" style="height:100px">
      <ul>
        <?php 
		foreach($im_catalog as $row1)
		{
			foreach($im_item as $row2)
			{
				if($row1->id==$row2->catalog_id)
				{
		?>
        <li><a target="_blank" href="<?php echo str_replace('{user_id}',$row2->user_id,$row1->hplink);?>"><img src='<?php echo get_real_path($row1->pic_path);?>' border='0' style="vertical-align:middle" /> <?php echo $row2->title;?></a><br />
        </li>
        <?php 
			}
		}
		}	
		?>
      </ul>
    </div>
    <div class="bottom"></div>
  </div>
</div>
<script type="text/javascript">
var tips; 
var theTop = 150; 
var old = theTop;
function initFloatTips() {
  tips = document.getElementById('siderIMchat');
  moveTips();
};
function moveTips() {
  var tt=50;
  if (window.innerHeight) {
    pos = window.pageYOffset
  }
  else if (document.documentElement && document.documentElement.scrollTop) {
    pos = document.documentElement.scrollTop
  }
  else if (document.body) {
    pos = document.body.scrollTop;
  }

  pos=pos-tips.offsetTop+theTop;
  pos=tips.offsetTop+pos/10;
	
  if (pos < theTop) pos = theTop;
  if (pos != old) {
    tips.style.top = pos+"px";
    tt=10;
  }
	
  old = pos;
  setTimeout(moveTips,tt);
}

initFloatTips();
$(function(){
	$("#siderIMchat").mouseover(function(){
		document.getElementById("siderIMchat_hiddenbar").style.display = "none";
		document.getElementById("siderIMchat_main").style.display = "block";
	});
	$("#siderIMchat").mouseout(function(){
		document.getElementById("siderIMchat_hiddenbar").style.display = "block";
		document.getElementById("siderIMchat_main").style.display = "none";
	});
	
});
</script>
